#include "frame.h"
#include <wx/listctrl.h>

MyFrame::MyFrame(): wxFrame(NULL, wxID_ANY, _T("wxBitmapButton 测试")){
	wxBoxSizer *frameSizer = new wxBoxSizer(wxHORIZONTAL);
	wxBoxSizer *btnSizer = new wxBoxSizer(wxVERTICAL);

	_pBtn = new wxBitmapButton(this, ID_BUTTON_SELECT, wxBitmap("png/button.png"));

	btnSizer->Add(_pBtn, 0, wxALIGN_CENTRE);
	frameSizer->Add(btnSizer, 1, wxALIGN_CENTRE);

	SetSizer(frameSizer);
	SetAutoLayout(TRUE);
	Layout();
}

void MyFrame::OnButtonSelect(wxCommandEvent& event){
	wxMessageBox("Hello, you got it");
}

void MyFrame::OnClose(wxCloseEvent& event){
	wxWindow::Destroy();
}

BEGIN_EVENT_TABLE(MyFrame, wxFrame)
	EVT_BUTTON(ID_BUTTON_SELECT, MyFrame::OnButtonSelect)
	EVT_CLOSE(MyFrame::OnClose)
END_EVENT_TABLE()
